' Michael Redmond Option Explicit On Option Strict On Public Class Form1 Inherits System.Windows.Forms.Form Const ptsToAdd As Integer = 3 #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents TxtPoints As System.Windows.Forms.TextBox Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents BtnGive As System.Windows.Forms.Button Private Sub InitializeComponent() Me.TxtPoints = New System.Windows.Forms.TextBox Me.Label1 = New System.Windows.Forms.Label Me.BtnGive = New System.Windows.Forms.Button Me.SuspendLayout() ' 'TxtPoints ' Me.TxtPoints.Location = New System.Drawing.Point(160, 80) Me.TxtPoints.Name = "TxtPoints" Me.TxtPoints.ReadOnly = True Me.TxtPoints.Size = New System.Drawing.Size(80, 20) Me.TxtPoints.TabIndex = 0 Me.TxtPoints.Text = "0" ' 'Label1 ' Me.Label1.Location = New System.Drawing.Point(40, 80) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(96, 16) Me.Label1.TabIndex = 1 Me.Label1.Text = "Points" ' 'BtnGive ' Me.BtnGive.Location = New System.Drawing.Point(104, 128) Me.BtnGive.Name = "BtnGive" Me.BtnGive.Size = New System.Drawing.Size(88, 32) Me.BtnGive.TabIndex = 2 Me.BtnGive.Text = "Give Me Points" ' 'Form1 ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(292, 273) Me.Controls.Add(Me.BtnGive) Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.TxtPoints) Me.Name = "Form1" Me.Text = "Form1" Me.ResumeLayout(False) End Sub #End Region Private Sub BtnGive_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnGive.Click Dim points As Integer points = Convert.ToInt32(TxtPoints.Text) points = points + ptsToAdd TxtPoints.Text = points.ToString("c") End Sub End Class